# define _CRT_SECURE_NO_WARNINGS 1
#include "Sort.h"

void Print(int* a, int len)
{
    for (int i = 0; i < len; i++)
    {
        printf("%d ", a[i]);
    }
    printf("\n");
}

void TestInsertSort()
{
    int a[] = { 2,4,6,4,1,1,8,4,2,0 };
    int len = sizeof(a) / sizeof(int);
    InsertSort(a, len);
    Print(a, len);
}

void TestShellSort()
{
    int a[] = { 2,4,6,4,1,1,8,4,2,0 };
    int len = sizeof(a) / sizeof(int);
    ShellSort(a, len);
    Print(a, len);
}

void TestHeapSort()
{
    int a[] = { 2,4,6,4,1,1,8,4,2,0 };
    int len = sizeof(a) / sizeof(int);
    HeapSort(a, len);
    Print(a, len);
}

void TestSelectSort()
{
    int a[] = { 2,4,6,4,1,1,8,4,2,0 };
    int len = sizeof(a) / sizeof(int);
    SelectSort(a, len);
    Print(a, len);
}

void TestBubbleSort()
{
    int a[] = { 2,4,6,4,1,1,8,4,2,0 };
    int len = sizeof(a) / sizeof(int);
    BubbleSort(a, len);
    Print(a, len);
}

void TestQuickSort()
{
    int a[] = { 49,38,65,97,76,13,27,49 };
    int len = sizeof(a) / sizeof(int);
    QuickSort(a, 0, len - 1);
    Print(a, len);
}

void TestMergeSort()
{
    int a[] = { 49,38,65,97,76,13,27,49 };
    int len = sizeof(a) / sizeof(int);
    MergeSort(a, len);
    Print(a, len);
}

void TestMergeSortNonR()
{
    int a[] = { 49,38,65,97,76,13,27,49 };
    int len = sizeof(a) / sizeof(int);
    MergeSortNonR(a, len);
    Print(a, len);
}

void TestCountSort()
{
    //int a[] = { 101, 100 ,101 ,103 ,103 ,101 ,109 };
    int a[] = { 49,38,65,97,76,13,27,49 };
    int len = sizeof(a) / sizeof(int);
    CountSort(a, len);
    Print(a, len);
}
int main()
{
    //TestInsertSort();
    //TestShellSort();
    TestHeapSort();
    //TestSelectSort();
    //TestBubbleSort();
    //TestQuickSort();
    //TestMergeSort();
    /*TestMergeSortNonR();*/
    //TestCountSort();
    return 0;
}